package com.mapper;

import com.pojo.CePing_x;
import com.pojo.Fm_x;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;
@Mapper
public interface CePingMapper_x {
    @Select("select * from ceping_x where del=1")
    @Results(id = "listAll",value = {
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "id",property = "num",one=@One(select = "com.mapper.QingXuMapper_x.getNum",fetchType = FetchType.LAZY))
    })
    List<CePing_x> listAll();
    @Select("select * from ceping_x")
    List<CePing_x> listAll2();

    @Insert("insert into ceping_x (title,img,del) values (#{title},#{img},#{del})")
    Integer add(CePing_x cePingX);
    @Update("update ceping_x set title=#{title},img=#{img},del=#{del} where id=#{id}")
    Integer update(CePing_x cePingX);
    @Delete("delete from ceping_x where id=#{id}")
    Integer delete(Integer id);
    public List<CePing_x> select(@Param("id") Integer id, @Param("title") String title);
}
